#!/usr/bin/env python3

# -*- coding: utf-8 -*-

# @author: zhangbo

# @time: 2025/3/24 16:35

import time

from datetime import datetime


class TimeStampDisposal:

    def time_stamp_disposal(self, time_list: list = None):
        """
        时间戳处理
        :param time_list:
        :return:
        """

        if time_list:
            result_list = []
            for ele in time_list:
                # 解析时间戳
                res = datetime.fromtimestamp(ele)
                # 将日期 转换合法格式
                time_format = "%Y-%m-%d %H:%M:%S"
                time_str = res.strftime(time_format)
                result_list.append(time_str)
            return result_list
        else:
            raise Exception("时间戳不能填写为空！")

